package com.bckj.fastboot.core.extra.i18n;

import com.bckj.fastboot.core.redis.RedisOps;
import lombok.RequiredArgsConstructor;

/**
 * DefaultI18nMessageRepository
 *
 * @author wfc
 **/
@RequiredArgsConstructor
public class DefaultI18nMessageRepository implements I18nMessageRepository {

    private final RedisOps redisOps;

    @Override
    public String findMessageByCodeAndLocale(String code, String locale) {
        return redisOps.hget(I18nCacheConstants.getI18nCacheKey(locale), code);
    }
}
